from django.db import models

# Create your models here.
class Address(models.Model):
    """
    地址信息表
    """
    users = models.ForeignKey('users.Users', on_delete=models.CASCADE)
    province = models.CharField(max_length=20, verbose_name='省份', null=False)
    city = models.CharField(max_length=20, verbose_name='城市', null=False)
    district = models.CharField(max_length=20, verbose_name='区/县', null=True)
    detailed = models.CharField(max_length=64, verbose_name='详细地址', null=False)
    signer_name = models.CharField(verbose_name="签收人", max_length=20, default="")
    signer_mobile = models.CharField(verbose_name="电话", max_length=11, default="")
    add_time = models.DateTimeField(verbose_name="添加时间", auto_now=True)

    def __str__(self):
        return self.detailed

